home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / D51_NARexx / DirToDest.dopus5 < prev    next >
Text File  |  1995-12-26  |  2KB  |  78 lines

  1. /* DirToDest for Directory Opus 5.
  2.  By Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.  email: leo.davidson@keble.oxford.ac.uk  www: http://info.ox.ac.uk/~kebl0364/
  4.  
  5. $VER: DirToDest.dopus5 1.4 (26.12.95)
  6.  
  7.    NOTE: This script _requires_ DOpus v5.11 or above.
  8.    NOTE: DOpusFuncs is an assembler version of this (and other) scripts.
  9.  
  10.    The scrips changes the DEST lister's path to the first selected directory
  11.    in the SOURCE lister. It's for when I don't want to reach for the SHIFT
  12.    key to drag-n-drop a directory into another lister.
  13.  
  14.    v1.00 -> v1.01 - Now deselects the directory. (Oops, forgot about that).
  15.    v1.01 -> v1.02 - V. small changes, nothing to think about.
  16.                     Now checks to make sure the DOPUS.x port exists.
  17.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  18.                     Style Guide compliant version numbering and $VER string.
  19.      v1.3 -> v1.4 - No change to functionality.
  20.  
  21. Call as:
  22. ------------------------------------------------------------------------------
  23. ARexx    DOpus5:ARexx/DirToDest.dopus5 {Qp}
  24. ------------------------------------------------------------------------------
  25. Turn off all switches.
  26. */
  27.  
  28. options results
  29. options failat 99
  30. signal on syntax;signal on ioerr        /* Error trapping */
  31. parse arg DOpusPort
  32. DOpusPort = Strip(DOpusPort,"B",'" ')
  33.  
  34. If DOpusPort="" THEN Do
  35.     Say "Not correctly called from Directory Opus 5!"
  36.     Say "Load this ARexx script into an editor for more info."
  37.     EXIT
  38.     END
  39. If ~Show("P",DOpusPort) Then Do
  40.     Say DOpusPort "is not a valid port."
  41.     EXIT
  42.     End
  43. Address value DOpusPort
  44.  
  45.  
  46. lister query source stem source_handle.
  47.  
  48. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  49.     dopus request '"You must have a SOURCE lister!" OK'
  50.     EXIT
  51.     End
  52.  
  53.  
  54. lister query dest stem dest_handle.
  55.  
  56. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  57.     dopus request '"You must have a DESTINATION lister!" OK'
  58.     EXIT
  59.     End
  60.  
  61.  
  62. lister query source_handle.0 path
  63. source_path = RESULT
  64. lister query source_handle.0 seldirs stem source_dir.
  65.  
  66. IF source_dir.count = 0 | source_dir.count = "SOURCE_DIR.COUNT" Then Do
  67.     dopus request '"You must have a directory selected'||X2C(0A)||'in the SOURCE lister!" OK'
  68.     EXIT
  69.     End
  70.  
  71. lister read dest_handle.0 source_path||source_dir.0
  72.  
  73. lister select source_handle.0 source_dir.0 0
  74. lister refresh source_handle.0
  75.  
  76. syntax:;ioerr:                /* In case of error, jump here */
  77. EXIT
  78.